package czStvDpds.collisionGeometry;

import java.awt.Point;

/**
 * Hitbox z jednoho bodu. Existuje pro uchovávání bodů se souřadnicemi typu
 * double
 *
 * @author Jirka
 */
public class PointHitBox {
    
    public double x, y;

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }
    
    public PointHitBox() {
        x = 0;
        y = 0;
    }
    
    public PointHitBox(Point p) {
        x = p.x;
        y = p.y;
    }
    
    public PointHitBox(PointHitBox p) {
        x = p.x;
        y = p.y;
    }
    
    public double getDistance(PointHitBox p) {
        double a = Math.abs(x - p.x);
        double b = Math.abs(y - p.y);
        return Math.sqrt((a * a) + (b * b));
    }
    
    public PointHitBox(double x, double y) {
        this.x = x;
        this.y = y;
    }
}
